package com.zhangzhan.gulimallcart.vos;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author 张一恒
 * @version 1.0
 * @description: 购物车商品详情
 * @date 2024/6/29 3:29
 */
public class CartItemVo {

    private Long skuId;
    private String title; //标题
    private String image; //图片
    private Boolean selected = true; //是否选中
    private List<String> skuAttrs; //商品sku属性
    private BigDecimal price; // 单价
    private Integer count; //数量
    private BigDecimal totalPrice; //总价

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Boolean getSelected() {
        return selected;
    }

    public void setSelected(Boolean selected) {
        this.selected = selected;
    }

    public List<String> getSkuAttrs() {
        return skuAttrs;
    }

    public void setSkuAttrs(List<String> skuAttrs) {
        this.skuAttrs = skuAttrs;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        //计算总价
        this.price = price;
    }

    public BigDecimal getTotalPrice() {
        this.totalPrice = getPrice().multiply(new BigDecimal(getCount()));
        return this.totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }
}
